<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page contentType="text/html; charset=UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>南开大学软件学院软件工程在线论坛</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">

		<link rel="stylesheet" type="text/css" href="forum/css/style.css">
		<script type="text/javascript" src="forum/js/mycheck.js"></script>
	</head>

	<body>
		<input type="hidden" id="initFlag" value="<s:property value='#flag'/>"/>
		<script type="text/javascript">
		var flag=document.getElementById("initFlag").value;
		if(flag!=1)
		{
			var uri ="/SE_Site/init.action";
			window.location.href=uri;
		}
		
		</script>
	<jsp:include page="include/header.jsp"></jsp:include>

		<table class="loginTable" border="0" align="center">
			<!--主题内容区-->
			<jsp:include page="include/welcomeBanner.jsp"></jsp:include>
			<tr>
				<td class="currentPos">
					<div style="float: left; width: 400px">
						<img src="forum/img/current.png" />
						当前位置：
						<span class="pos"> <s:a action="init" namespace="/">首页</s:a>
						</span>
					</div>
					<jsp:include page="include/searchDiv.jsp"></jsp:include>
				</td>
				<td>

				</td>
			</tr>
			<tr>
				<td>
					<hr size="4" color="#B5BAC7" style="margin-top: 0px;">
				</td>
			</tr>
			<!--论坛主体部分-->

			<s:iterator var="section" value="#request.sections">
				<tr>
					<td>
						<div class="section">
							<div class="titleBar">
								<div style="width: 820px; float: left">
									<span><img src="forum/img/titleIcon.png" height=28
											width=28 align=left> <s:property
											value="#section.sectionName" /> </span>
								</div>
								<div>
									<span>版主：<s:property value="#section.user.name" /> </span>
								</div>
							</div>
							<div>
								<hr>
							</div>
							<div>
								<table border="0" width="100%">
								<tr>
								<td  >
								<div style="float: left; width: 80px;">
									<s:a action="scan!prepareToPost.action">
										<img src="forum/img/publish_btn.png" border="0">
										<s:param name="sid">
											<s:property value="#section.sid" />
										</s:param>
									</s:a>
								</div>
								</td>
								<td>
								<div style="float: right; width: 100px">
									<s:a action="scan!getMoreTopics">
										<s:param name="sid" value="#section.sid" />
									更多
								</s:a>
								</div>
								</td>
								</tr>
								</table>
							</div>
							<div class="articleList">
								<table width="960px" border="0">
									<tr class="subStitle" style="background: #D7A8E6">
										<td style="width: 600px;padding-left:15px;"">
											主题
										</td>
										<td>
											作者
										</td>

										<td >
											发表时间
											</td>

										<s:if test="#session.userInfo.limits.delete==true">
											<s:iterator var="sec" value="#session.userInfo.sections">
												<s:if test="#sec.sectionName==#section.sectionName">
													<td>
														编辑
													</td>

												</s:if>
											</s:iterator>
										</s:if>
									</tr>

									<s:subset source="#section.topics" start="0" count="8">
										<s:iterator id="topic">
											<tr >
												<td style="padding-left:10px;">
													<s:a action="scan" method="showTopicReplys">
														<s:property value="#topic.title" />
														<s:param name="tid" value="#topic.id" />
													</s:a>
												</td>
												<td>
													<s:property value="#topic.user.name" />
												</td>

												<td >
													<s:property value="#topic.pubTime" />
												</td>

												<!-- 缺少用户权限校验 -->

												<s:if test="#session.userInfo.limits.delete==true">
													<s:iterator var="sec" value="#session.userInfo.sections">
														<s:if test="#sec.sectionName==#section.sectionName">
															<td>
																<a
																	href="JavaScript:showMsg(<s:property value="#topic.id"/>);">删除
																	<s:param name="tid" value="#topic.id" /> </a>
															</td>

														</s:if>
													</s:iterator>
												</s:if>

											</tr>
											<tr>
												<td colspan="4"><hr style="color:#eee;border-top:1px solid #eee;"></td>
											</tr>
										</s:iterator>
									</s:subset>

								</table>
							</div>
						</div>
					</td>
				</tr>
				<tr>
					<td>
						<hr size="3" color="#B5BAC7">
					</td>
				</tr>
			</s:iterator>

		</table>
		<jsp:include page="include/footer.jsp"></jsp:include>
	</body>
</html>
